package models;

import java.util.ArrayList;

public class Task {
    public String name = "";
    public ArrayList<Action> sub_tasks = new ArrayList<>();
    public String id = "";
    public Action current_task = null;
    public String state = "";

    public String getState() {
        return state;
    }

    public void setState(String state) {
        this.state = state;
    }

    public Action getCurrent_task() {
        return current_task;
    }

    public void setCurrent_task(Action current_task) {
        this.current_task = current_task;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public ArrayList<Action> getSub_tasks() {
        return sub_tasks;
    }

    public void setSub_tasks(ArrayList<Action> sub_tasks) {
        this.sub_tasks = sub_tasks;
    }

    // 由于java不能动态类型，在此处转成action类型方便处理
    public Action toAction(){
        Action action = new Action();
        action.id = id;
        action.state = state;
        action.type = "task";
        return action;
    }
}
